.floating-ball {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: 3px solid #fff;
  border-radius: 50%;
  cursor: pointer;
  z-index: 1000;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 8px 32px rgba(102, 126, 234, 0.4), 0 0 0 4px rgba(102, 126, 234, 0.2);
  opacity: 1;
  transform: translateX(0) scale(1);
  user-select: none;
}

.floating-ball.visible {
  opacity: 1;
  transform: scale(1) translateY(0);
}

.floating-ball:hover {
  transform: scale(1.1);
  box-shadow: 0 12px 40px rgba(102, 126, 234, 0.6);
}

.floating-ball:active {
  transform: scale(0.95);
}

.floating-ball-inner {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  position: relative;
  z-index: 2;
}

.floating-ball-icon {
  color: white;
  transition: transform 0.3s ease;
}

.floating-ball:hover .floating-ball-icon {
  transform: rotate(15deg);
}

/* 脉冲环效果 */
.floating-ball-pulse-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  border: 2px solid rgba(102, 126, 234, 0.6);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  animation: pulse-ring 2s infinite;
  pointer-events: none;
}

.floating-ball-pulse-ring.delay-1 {
  animation-delay: 0.5s;
}

.floating-ball-pulse-ring.delay-2 {
  animation-delay: 1s;
}

.floating-ball.pulsing .floating-ball-pulse-ring {
  animation: pulse-ring-active 1s ease-out;
}

@keyframes pulse-ring {
  0% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) scale(2);
    opacity: 0;
  }
}

@keyframes pulse-ring-active {
  0% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.8;
  }
  100% {
    transform: translate(-50%, -50%) scale(2.5);
    opacity: 0;
  }
}

/* 工具提示 */
.floating-ball-tooltip {
  position: absolute;
  bottom: 70px;
  right: 0;
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s ease;
  pointer-events: none;
  z-index: 1001;
}

.floating-ball-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  right: 20px;
  border: 5px solid transparent;
  border-top-color: rgba(0, 0, 0, 0.8);
}

.floating-ball:hover .floating-ball-tooltip {
  opacity: 1;
  transform: translateY(0);
}

/* 呼吸动画 */
.floating-ball::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(135deg, #667eea, #764ba2, #667eea);
  border-radius: 50%;
  z-index: -1;
  animation: breathe 3s ease-in-out infinite;
}

@keyframes breathe {
  0%, 100% {
    transform: scale(1);
    opacity: 0.7;
  }
  50% {
    transform: scale(1.05);
    opacity: 0.3;
  }
}

@keyframes slideInFromRight {
  0% {
    opacity: 0;
    transform: translateX(100px) scale(0.8);
  }
  100% {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

/* 响应式设计 */
@media (max-width: 768px) {
  .floating-ball {
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
  }
  
  .floating-ball-icon svg {
    width: 20px;
    height: 20px;
  }
  
  .floating-ball-tooltip {
    bottom: 60px;
    right: -10px;
    font-size: 11px;
  }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
  .floating-ball {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    box-shadow: 0 8px 32px rgba(79, 70, 229, 0.4);
  }
  
  .floating-ball-pulse-ring {
    border-color: rgba(79, 70, 229, 0.6);
  }
}
